<script>
	import {
		license
	} from '@/utils/license'
	import {
		checkUpdate
	} from '@/utils/appHot'
	export default {
		onLaunch: function() {
			// console.log("App Launch-->", license);】’
			const info = uni.getSystemInfoSync();
			const obj = {
				deviceid: info.deviceId,
				platform: 'android',
				branch: info.brand,
				license
			}

			this.$http
				.post("api/index/regdevice", obj)
				.then((res) => {
					console.log('res=>>=', res);
				});


			uni.getSystemInfo({
				success(res) {
					uni.setStorageSync("safeArea", res.safeArea);
				},
			});

			uni.setStorageSync("app-license", license)

			// 查询版本状态
			const showAuthPopup = uni.getStorageSync("showAuthPopup")
			const first_run = uni.getStorageSync("first_run")
			const location = uni.getStorageSync('location');
			// console.log('checkUpdate()--->',showAuthPopup, location);
			// console.log("first_run--->", first_run);
			if (showAuthPopup > 0 && location && Number(first_run) === 1) {
				checkUpdate()
			}
		},
		onShow: function() {
			// console.log("App Show");
		},
		onHide: function() {
			// console.log("App Hide");
		},
	};
</script>

<style lang="scss">
	/*每个页面公共css */
	@import "./style/font.css";
	@import "./style/common.scss";
	@import "./style/modal.css";
	// @import "./static/iconfont.css";

	page {
		font-family: PingFangSC-Regular, PingFang SC;
		background-color: #f5f5f5;
	}

	.tl {
		text-decoration: line-through;
	}

	.u-read-more__conten {
		text-indent: 0 !important;
	}

	.flex {
		display: flex;
	}

	.flex1 {
		flex: 1;
	}

	.jus {
		justify-content: space-between;
	}

	.ane {
		align-items: center;
	}

	.slot-content {
		font-size: 32rpx !important;
	}

	.content-top {
		align-items: center;
	}

	.content-center {
		align-items: center;
	}
</style>